<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Blog后台</title>
    <link rel="stylesheet" th:href="@{/css/bootstrap.css}">
    <link rel="stylesheet" th:href="@{/css/amazeui.css}">
    <script th:src="@{/js/jquery.js}"></script>
    <script th:src="@{/js/bootstrap.js}"></script>
</head>
<body style="background-color:#eee;">

<div th:replace="~{commons/admin/topbar::top-bar}"></div>


<div class="row">

    <!--    引入共有侧边栏-->
    <div th:replace="~{commons/admin/leftbar::left-bar}"></div>

    <div class="col-xs-12 col-sm-9 col-md-10 pull-right" style="background-color:#FFFFFF;margin-top: 52px;">
        <div class="row bg-info text-center">
            <h4>管理后台用户</h4>
        </div><br>

        <div class="well">
            <form class="form-inline" method="post" th:action="@{/admin/searchUser/}+@{1}">
                <div class="form-group">
                    <label>用户名：</label>
                    <input type="text" name="username" class="form-control" placeholder="用户名">
                </div>
                <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span>&nbsp;搜索</button>
            </form>
        </div>

        <div class="container-fluid" style="min-height: 800px;">
            <div class="row">
                <div class="table-responsive">
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th>用户名</th>
                            <th>真实姓名</th>
                            <th>性别</th>
                            <th>QQ</th>
                            <th>wechat</th>
                            <th>个人简介</th>
                            <th>操作</th>
                        </tr>
                        </thead>

                        <tbody>
                        <tr th:each="user : ${users}">
                            <td th:text="${user.username}"></td>
                            <td th:text="${user.trueName}"></td>
                            <td th:if="${user.gender}==1" th:text="男"></td>
                            <td th:if="${user.gender}==0" th:text="女"></td>
                            <td th:text="${user.qq}"></td>
                            <td th:text="${user.wechat}"></td>
                            <td th:text="${user.personalBrief}"></td>
                            <td>
                                <a class="btn-sm btn-primary" th:href="@{/admin/toupdateUserInfo/}+@{${user.username}}">编辑</a>
                                &nbsp;|&nbsp;
                                <a class="btn-sm btn-danger" th:href="@{/admin/deleteUser/}+@{${user.username}}">删除</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>

                    <ul class="am-pagination">
                        <li><a th:href="@{/admin/allUser/}+@{${prevPage}}">&laquo; 上一页</a></li>
                        <li><a th:href="@{/admin/allUser/}+@{${nextPage}}">下一页 &raquo;</a></li>
                    </ul>
                    共找到<span style="font-weight: 400;font-size: 18px;color: #4d99de" th:text="${userSize}+1"></span> 名用户
                </div>
            </div>
        </div>
        <div class="pull-right"><a href="" target="_blank">Power By Wangzz</a>&nbsp;&nbsp;</div>
    </div>

</div>

</body>
</html>